package com.service;

import com.mapper.F_inforDao;
import com.mapper.F_userDao;
import com.util.*;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class F_userService {
    @Resource
    private F_userDao f_userDao;
    @Resource
    private F_inforDao f_inforDao;
    public Result<?> add(F_register f_register) {
        F_user f_user=new F_user();
        f_user.setcAccount(f_register.getcAccount());
        f_user.setfPassword(f_register.getfPassword());
        f_user.setpId(f_register.getpId());
        F_infor f_infor=new F_infor();
        f_infor.setcAccount(f_register.getcAccount());
        f_infor.setfName(f_register.getfName());
        f_infor.setRepresentative(f_register.getRepresentative());
        f_infor.setSignature(f_register.getSignature());
        f_infor.setClient(f_register.getClient());
        f_infor.setIndustry(f_register.getIndustry());
        f_infor.setNature(f_register.getNature());
        f_infor.setLevel(f_register.getLevel());
        f_infor.setpId(f_register.getpId());
        Result result=new Result();
        f_userDao.insert(f_user);
        f_inforDao.insert(f_infor);
        Result r=result.success(result);
        return r;
    }
}
